<?php

/**
 * view single_product_view:
 * an HTML representation of a single product with CSS. Updated for use in multiple sites.
 * @author Joseph Root <joe.r@siliconsolar.com>
 * @version 1.0
 * @copyright Silicon Solar 2009-2010
 * @package Products
 */


/*
 * This file is responsible for producing a view of the seminars that can
 * be loaded to other sites across the silicon solar world of sites
 */

setlocale(LC_MONETARY, 'en_US');
?>

<style type="text/css">
   @import "<?=$cssFile?>";
</style>
<style>
	.productImg img { width: 210px; float: left; margin-right: 20px; margin-bottom: 10px; }
	#product_, .productView, { width: 560px; padding: 20px; background-color: #ffffff; }
		.product { width: 560px; }
	.productView .productName { font-size: 20px; font-weight: bold; color: #e77d1d; margin: 0px; margin-bottom: 10px; }
	p.productDescription { font-size: 15px; font-weight: bold; color: #002d55; }
	.popupcloselink a, .popupcloselink a:visited { display: block; width: 150px; height: 40px; line-height: 40px; text-align: center; background-color: #e77d1d; color: #ffffff; text-decoration: none; font-size: 14px; fone-weight: bold; }
		.popupcloselink a:hover { background-color: #002d55; }
		.productPrices a.textlink, .productPrices a.textlink:visited { color: #002d55; text-decoration: none;" }
			.productPrices a.textlink:hover { color: #e77d1d; }
</style>

<div id="product_<?php echo $productID; ?>" class="productView" style="width: 560px; padding: 20px; margin: 20px; margin-left: auto; margin-right: auto; font-family: arial; font-size: 12px;">
	<div class="product">
    	<div class="productName"><strong><?php echo $product; ?></strong></div>
		<div class="productImg">
			<img src="http://www.sunmaxxsolar.com/images/pr-featured-image-holder.jpg" alt="SunMaxx Solar Thermal Products" />
			<!-- <img src="<?php // echo $image_path; ?>" <?php // echo $dimSet; ?> alt="<?php // echo $product; ?>" /><br/> -->
		</div>
      <div class="productContent">
         <div class="productSKU" style="margin-bottom: 5px;"><strong>Sku:</strong> <em><?php echo $productcode; ?></em></div>
         <span class="productPrices">
			<strong>How To Buy:</strong> 1.877.786.6299 | <a href="http://www.sunmaxxsolar.com/contact-sunmaxx-blank.php&bodywidth=560px" class="textlink">Click here</a>
		 <?php //
            // foreach ($prices as $price)
            // {
            //   echo 'Buy '.$price['quantity'].' for just '.money_format('%n', $price['price']).' each!<br/>';
            // }
         // ?>
         </span>
         
         <h3>Product Documents:</h3>
         
         <table style="font-size: 12px;">
	<tr>
    	<td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-brochureheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-datasheetheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-installmanualheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-warrantyheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-srccheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-2dcadheader.png' width='25px'/></td>
        <td width="25" height="100"><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-3dcadheader.png' width='25px'/></td>
    </tr>
    <tr>
    	<td width="25" height="25">
        	<?php $brochure = $_GET['brochure'];
				if (!empty($brochure)){
				echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$brochure."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-brochureicon.jpg' height='25px' title='Product Brochure'/></a>";
			} else {
				echo "N/A";
			} ?>
        </td>
        <td width="25" height="25">
        	<?php $datasheet = $_GET['datasheet'];
				if (!empty($datasheet)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$datasheet."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-datasheeticon.jpg' height='25px' title='Product Data Sheet'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
        <td width="25" height="25">
        	<?php $install = $_GET['install'];
				if (!empty($install)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$install."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-installmanualicon.jpg' height='25px' title='Product Installation Manual'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
        <td width="25" height="25">
        	<?php $install = $_GET['install'];
				if (!empty($install)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$warranty."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-warrantyicon.jpg' height='25px' title='Product Warranty'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
        <td width="25" height="25">
        	<?php $srcc = $_GET['srcc'];
				if (!empty($srcc)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$srcc."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-srccog100icon.jpg' height='25px' title='Product SRCC Certification'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
        <td width="25" height="25">
        	<?php $twodcad = $_GET['twodcad'];
				if (!empty($twodcad)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$twodcad."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-2dcadicon.jpg' height='25px' title='Product 2D CAD Drawing'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
        <td width="25" height="25">
        	<?php $threedcad = $_GET['threedcad'];
				if (!empty($threedcad)){
					echo "<a href='http://www.siliconsolar.com/admin/kt_download.php?document_id=".$threedcad."'><img class='DocIcon' src='http://www.sunmaxxsolar.com/images/docicons/pl-3dcadicon.jpg' height='25px' title='Product 3D CAD Drawing'/></a>";
				} else {
					echo "N/A";
				} ?>
        </td>
    </tr>
</table>
         
         <div style="width: 100%; height: 0px; clear: both;"></div>
         <p class="productDescription">
            <strong>Product Information:</strong><br/>
            <span class="productDescriptionText"><?php echo $fulldescr; ?></span>
         </p>

		</div>
	</div>
    
    <div class="ProductSpecificationsContainer">
        <style type="text/css">
            @import "http://www.siliconsolar.com/ff/css/productSpecs.css";
        </style>
        <table class="specTable" cellpadding="1" cellspacing="1">
            <tr class="specTableHeaderRow">
                <td colspan="2" class="specTableHeaderCell"><h3>Product Specifications</h3></td>
            </tr>
        <?php
            if (!empty($prodSpecs))
            {
                foreach ($prodSpecs as $spec)
                {
                if($spec['cpc_Visible'] == 1 ){
                ?>
        <tr class="specTableSpecsRow">
            <td class="specTableSpecName"><?php echo $spec['cpc_FieldDisplayName']; ?>: </td>
            <td class="specTableSpecValue"><?php echo $spec['cps_SpecValue']; ?> <?php echo $spec['cpu_Abbr']; ?></td>
        </tr>
        <?php
                    }
                }
            }
        ?>       
        </table>
    </div>
    
    <?php if (!empty($productDocuments)) {?>
    <div class="ProductDocumentsTitle">
        Documents and Collateral
    </div>
    <ul class="productDocumentsContainer">
        <? foreach($productDocuments as $DocumentID => $DocumentData) { ?>
        <li class="DocumentData">
            <a href="http://www.siliconsolar.com/admin/kt_download.php?document_id=<?=$DocumentID?>" class="DocumentDownloadLink">
                <?php echo $DocumentData['name'];?>
            </a>
            <span class="DocumentLastUpdate"><?php echo $DocumentData['version_created'];?></span>
            <span class="DocumentFileType"><?php echo $DocumentData['document_type'];?></span>
            <span class="DocumentSize"><?php echo round($DocumentData['size']/1024);?> kb</span>
        </li>
        <? } ?>
    </ul>
    <? } ?>
</div>
